package uit.cinemainfo;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;

public class DetailNewsActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_detail_news);
		
		RSSObject selectedRssItem = ListNewsActivity.selectedItem;		
		WebView webView = (WebView) findViewById(R.id.webView1);
		webView.getSettings().setJavaScriptEnabled(true);
		//webView.getSettings().setBuiltInZoomControls(true);
		//webView.getSettings().set
		webView.loadUrl(selectedRssItem.getLink());
				;

	
		//contentTv.setText(content);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_detail_news, menu);
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
	    // Handle item selection
	    switch (item.getItemId()) {
	        case R.id.menu_showing:
	        	StartShowing();
	            return true;
	        case R.id.menu_coming:
	        	StartComing();
	            return true;
	        case R.id.menu_theater:
	        	StartTheater();
	        	return true;
	        case R.id.menu_news:
	        	StartNews();
	        	return true;
	        default:
	            return super.onOptionsItemSelected(item);
	    }
	}
	
	public void StartComing(){
		Intent intent = new Intent(DetailNewsActivity.this, ComingActivity.class);
		startActivity(intent);
	}
	
	public void StartShowing(){
		Intent intent = new Intent(DetailNewsActivity.this, ShowingActivity.class);
		startActivity(intent);
	}
	
	public void StartTheater(){
		Intent intent = new Intent(DetailNewsActivity.this, TheaterActivity.class);
		startActivity(intent);
	}
	
	public void StartNews(){
		Intent intent = new Intent(DetailNewsActivity.this, ListNewsActivity.class);
		startActivity(intent);
	}
}
